﻿using System;

namespace Sustainalytics.ScreeningTool.Service
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler((obj, args) =>
            {
                Console.WriteLine(((Exception)args.ExceptionObject).ToString());
            });

            if (Environment.UserInteractive)
            {
                // start as console app
                ProgramConsole.Start();
            }
            else
            {
                // start as windows service
                ProgramWindowsService.Start();
            }

        }
    }
}
